﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MixScript.Appl.StartUp;

namespace MixScriptWeb
{

    public partial class _Default : System.Web.UI.Page
    {
       
        protected void Page_Load(object sender, EventArgs e)
        {
            cmStartUp ostart = new cmStartUp();
            if (ostart.runStartUp() == formStart.loginForm)
            {
                //return RedirectToAction("LogOn", "Account");
               Response.Redirect("/login.html");
             //  Response.Redirect("/welcome.html");
               // cBrowserRedirect.RedirectedPage(this, false, "/Account/masuk.aspx");

            }
            else
            {
                //return RedirectToAction("Create", "Config");
                //Response.Redirect("/settingConnection.html");
                Response.Redirect("/settingConnection.html");
                //cBrowserRedirect.RedirectedPage(this, false, "/referensi/DBSetup.aspx");

            }

        }
    }

    public class cmStartUp : cDBSetting
    {
        //private System.Windows.Forms.Form fm;

        public cmStartUp()
        {


        }


        public formStart runStartUp()
        {
            try
            {

                if (Dbserver.tesConn())
                {
                    //fm = new fLogin();
                    return formStart.loginForm;
                }
                else
                {
                    return formStart.DBSettingForm;
                }


            }
            catch
            {
                // fm = new fDBSetting();

                return formStart.DBSettingForm;
            }
        }


    }
}
